1) What books topped the Hardcover Fiction NYT best-sellers list on Mother's Day in 2009 and 2010? How about Father's Day?


In [73]:
# APIKEY = 422004d03a794f1db979e02a81969b56
import requests 
response = requests.get("https://api.nytimes.com/svc/books/v3/lists.json?list=hardcover-fiction&published-date=2009-05-10&api-key=422004d03a794f1db979e02a81969b56")
data = response.json() 
#print (data)
#print(data.keys())

In [74]:
#print(data['results']) 
#print(data['results'][0]) 
#print(data['results'][0]['book_details'][0])
#print(data['results'][0]['book_details'][0]['title'])

In [75]:
print("On Mother's Day in 2009, the following books topped the bestseller list: " )
for item in data['results']:
    for item in item['book_details']: 
        print(item['title'])


On Mother's Day in 2009, the following books topped the bestseller list: 
FIRST FAMILY
TEA TIME FOR THE TRADITIONALLY BUILT
LOITERING WITH INTENT
JUST TAKE MY HEART
THE PERFECT POISON
THE HOST
LOOK AGAIN
DEADLOCK
LONG LOST
TURN COAT
THE ASSOCIATE
HANDLE WITH CARE
THE HELP
THE GUERNSEY LITERARY AND POTATO PEEL PIE SOCIETY
FATALLY FLAKY
ARTHAS
A RELIABLE WIFE
BORDERLINE
ONE SECOND AFTER
BONEMAN'S DAUGHTERS

In [76]:
#request data 
import requests 
response = requests.get("https://api.nytimes.com/svc/books/v3/lists.json?list=hardcover-fiction&published-date=2010-05-09&api-key=422004d03a794f1db979e02a81969b56")
data = response.json() 

#print books on hardcover fiction bestseller list
print("On Mother's Day in 2010, the following books topped the bestseller list: " )
for item in data['results']:
    for item in item['book_details']: 
        print(item['title'])


On Mother's Day in 2010, the following books topped the bestseller list: 
DELIVER US FROM EVIL
THE HELP
THE DOUBLE COMFORT SAFARI CLUB
THIS BODY OF DEATH
LUCID INTERVALS
THE SHADOW OF YOUR SMILE
BURNING LAMP
EVERY LAST ONE
EIGHT DAYS TO LIVE
CHANGES
CAUGHT
HOUSE RULES
MATTERHORN
THE WALK
DECEPTION
BEATRICE AND VIRGIL
WRECKED
SILVER BORNE
ABRAHAM LINCOLN: VAMPIRE HUNTER
A RIVER IN THE SKY

In [77]:
#request data 
import requests 
response = requests.get("https://api.nytimes.com/svc/books/v3/lists.json?list=hardcover-fiction&published-date=2009-06-21&api-key=422004d03a794f1db979e02a81969b56")
data = response.json() 

#print books on hardcover fiction bestseller list
print("On Father's Day in 2009, the following books topped the bestseller list: " )
for item in data['results']:
    for item in item['book_details']: 
        print(item['title'])


On Father's Day in 2009, the following books topped the bestseller list: 
SKIN TRADE
MEDUSA
THE SCARECROW
SHANGHAI GIRLS
MATTERS OF THE HEART
GONE TOMORROW
DEAD AND GONE
THE 8TH CONFESSION
THE STRAIN
WICKED PREY
THE HOST
FIRST FAMILY
CEMETERY DANCE
UNDEAD AND UNWELCOME
THE HELP
PYGMY
MY FATHER'S TEARS AND OTHER STORIES
ROAD DOGS
THE STORY SISTERS
HEARTLESS

In [78]:
#request data 
import requests 
response = requests.get("https://api.nytimes.com/svc/books/v3/lists.json?list=hardcover-fiction&published-date=2010-06-20&api-key=422004d03a794f1db979e02a81969b56")
data = response.json() 

#print books on hardcover fiction bestseller list
print("On Father's Day in 2010, the following books topped the bestseller list: " )
for item in data['results']:
    for item in item['book_details']: 
        print(item['title'])


On Father's Day in 2010, the following books topped the bestseller list: 
THE GIRL WHO KICKED THE HORNET’S NEST
BULLET
THE SPY
THE HELP
DEAD IN THE FAMILY
61 HOURS
THE BURNING WIRE
STORM PREY
THE BOURNE OBJECTIVE
INNOCENT
HEART OF THE MATTER
THE 9TH JUDGMENT
BLOCKADE BILLY
ALLIES
THE RULE OF NINE
FEVER DREAM
DELIVER US FROM EVIL
MATTERHORN
THE PARTICULAR SADNESS OF LEMON CAKE
DANGEROUS